<script>
    $(function() {
        $("#born__gte").datepicker({ dateFormat:'yy-mm-dd', duration: '' });
        $("#born__lte").datepicker({ dateFormat:'yy-mm-dd', duration: '' });
    });
    
    function remove(){
        location = "{{query_string}}"
    }
    
    function go(){
        base = "{{query_string}}"
        from = $("#born__gte").attr("value")
        to = $("#born__lte").attr("value")

        if (from != ""){
            base += "&born__gte=" + from
        }
        if (to != ""){
            base += "&born__lte=" + to
        }
        
        if (base != "{{query_string}}"){
            location = base
        }
    }
</script>
<div class="filter-content">
<h3>By {{title}}</h3>
from:<input size="8" type="text" name="born__gte" id="born__gte" value="{{from}}"> 
to&nbsp;&nbsp;:<input size="8" type="text" name="born__lte" id="born__lte" value="{{to}}">
<hr>
<a href="javascript:remove();">clear</a> -  <a href="javascript:go();">apply filter</a> 
</div>
